"""
File: user.py
Author: ershixiong
Date: 2023/12/28
describe:

"""
from hogwarts.WeworkApi.apis.wework import Wework


class User(Wework):
    def create(self, data):
        url = 'user/create'
        pay_load = {
            'method': 'post',
            'url': url,
            'json': data,
        }
        res = self.send(pay_load)
        return res

    def update(self, data):
        url = 'user/update'
        pay_load = {
            'method': 'post',
            'url': url,
            'json': data
        }
        res = self.send(pay_load)
        return res

    # 获取成员ID列表
    def list(self, data):
        url = 'user/list_id'
        pay_load = {
            'method': 'get',
            'url': url,
            'json': data
        }
        res = self.send(pay_load)
        return res

    def delete(self, userid):
        url = 'user/delete'
        params = {
            'userid': userid
        }
        pay_load = {
            'method': 'get',
            'url': url,
            'params': params
        }
        res = self.send(pay_load)
        return res
